home *** CD-ROM | disk | FTP | other *** search
/ Magnum One / Magnum One (Mid-American Digital) (Disc Manufacturing).iso / d12 / c_toolbx.arc / VIDEO4.C < prev    next >
Encoding:
C/C++ Source or Header  |  1988-03-30  |  1.5 KB  |  39 lines

  1. /*  video4.c - higher level char and string output */
  2.  
  3. #include   "stdio.h"
  4. #include   "cminor.h"
  5. #include   "keyio.h"
  6. #include   "video.h"
  7.  
  8. int  vid_tca(c,a)                       /* output char with attribute */
  9.   int   c  ;                            /* char value */
  10.   int   a  ;                            /* attribute value */
  11.   {
  12.                                         /* don't write attribute if  */
  13.      if(   (c != ASCBEL)                /* it is a special char */
  14.         && (c != ASCCR ) &&  (c != ASCLF)
  15.         && (c != ASCBS ) )
  16.         vid_wca(c,a) ;                  /* write out the attrib. */
  17.      vid_tc(c) ;                        /* now write char & advance cur. */
  18.   }
  19.  
  20. int  vid_ts(s)                          /* output a string with TTY write */
  21.   char  *s ;                            /* the string to output */
  22.   {
  23.      while( *s != '\0' )                /* repeat until end of string */
  24.         {  vid_tc(*s) ;                 /* output current char */
  25.            s = s + 1 ;                  /* point to next char */
  26.         }
  27.   }
  28.  
  29.  
  30. int  vid_tsa(s,a)                       /* output string with attribute */
  31.   char  *s ;                            /* the string to output */
  32.   int   a  ;                            /* the attribute */
  33.   {
  34.      while( *s != '\0' )                /* repeat until end of string */
  35.         {  vid_tca(*s,a) ;              /* output curr. char & attribute */
  36.            s = s + 1 ;                  /* point to next char */
  37.         }
  38.   }
  39.